module namespace merchandisingview = "http://www.xmlproject.com/smi/lib/view/merchandisingview";

declare sequential function merchandisingview:show($merchandisingResults)
{
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
            <meta name="description" content="" />
            <meta name="keywords" content="" />
            <title>Merchandising</title>
            <link href="/css/style.css" rel="stylesheet" type="text/css"/>
        </head>
        <body>
            <div id="wrap">
                <div id="header" align="left">
                </div>
                
                <div id="menu">
                    <a href="../moviesearch/index.xq" class="selected">Home Page</a>
                    <a href="../moviesearch/aboutus.xq" class="selected">About us</a>
                </div>
                
                <div id="body">
                    <div id="top" align="center">
                        <h1>Merchandising</h1>
                            <form id="search-form" action="/merchandising/showItems" method="GET">
                                <p>
                                <input type="text" size="60" name="query" value="" />
                                <input type="submit" value="Search Merchandising" />
                                </p>
                            </form>
                            <hr/>
                    </div>    
                    <div id="singleContent">
                        <center><h2>Merchandising!</h2></center>
                        {
                            for $block in $merchandisingResults/block
                            return 
                                <div>
                                    <p>{$block/title/text()}</p>
                                    <a href="{$block/ebayUrl/text()}"><img src="{$block/imgUrl/text()}"/></a>
                                </div>
                        }                       
                    </div> 
                    <div id="footer"> Project of XML and Databases :: Master in Applied Computer Science, University of Freiburg 2012</div>
                </div>                
                <div id="bottom">
                </div>
            </div>
        </body>
      </html>
};


